package com.example.myapplication;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public class Lbou extends RecyclerView.Adapter<Lbou.Honder> {


//    private final int[]dfs;
    List<Lunjiekou.Data.BannersList> bannersLists;

    public Lbou(List<Lunjiekou.Data.BannersList> bannersLists) {
        this.bannersLists = bannersLists;
    }

    @NonNull
    @Override
    public Honder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View lichunyu = LayoutInflater.from(parent.getContext()).inflate(R.layout.lbou,parent,false);
        return new Honder(lichunyu);
    }

    @Override
    public void onBindViewHolder(@NonNull Honder holder, int position) {
        new util().setWebImage("https://photo.vshare.site" + this.bannersLists.get(position).getLitpic(),holder.imageView2);
//        holder.imageView2.setImageResource(this.dfs[position]);
    }

    @Override
    public int getItemCount() {
        return this.bannersLists.size();
//        return dfs.length;
    }

    public class Honder extends RecyclerView.ViewHolder {


        ImageView imageView2;
        public Honder(@NonNull View itemView) {
            super(itemView);
            imageView2 =itemView.findViewById(R.id.imageView2);
        }
    }
}
